package com.hospicpc.demos.service.Impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.hospicpc.demos.entity.Articles;
import com.hospicpc.demos.service.ArticlesService;
import com.hospicpc.demos.mapper.ArticlesMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author t
* @description 针对表【tb_articles】的数据库操作Service实现
* @createDate 2024-03-12 22:12:51
*/
@Service
public class ArticlesServiceImpl extends ServiceImpl<ArticlesMapper, Articles> implements ArticlesService{

    @Autowired
    ArticlesMapper articlesMapper;

    @Override
    public List<Articles> getListPage(Integer page,Integer pageNumber) {
        //处理page<0的情况
        page = page > 0 ? page : 0;
        return articlesMapper.getPage(page,pageNumber);
    }

    @Override
    public List<Articles> getCollectArticleList(Long userId) {
        return articlesMapper.getCollectArticleList(userId);
    }
}




